﻿using System.Data.Entity.ModelConfiguration;
using ZY.EntityFrameWork.Core.Model.Entity;
using ZY.EntityFrameWork.Core.Model.Entity.Authority;

namespace ZY.EntityFrameWork.Core.Mapping.SQLServer
{
    public class RoleModuleMap : EntityTypeConfiguration<RoleModule>
    {
        public RoleModuleMap()
        {
            ToTable("RoleModuleInfo").HasKey(q => q.Id);
            HasRequired(q => q.Module).WithMany(q=>q.RoleModules).HasForeignKey(q=>q.ModuleId);
            //HasRequired(q => q.Role).WithMany(q => q.RoleModules).HasForeignKey(q => q.RoleId);
            //HasRequired(q => q.Permission).WithMany(q => q.ModulePermissions).HasForeignKey(q => q.PermissionId);
        }
    }
}
